var mongoose = require('mongoose');

//分类的表结构
module.exports = new mongoose.Schema({
    //关联字段  分类的ID
    category: {
        type: mongoose.Schema.ObjectId,
        //引用
        ref: 'category'
    },
    title: String,
    addTime: {
        type: Date,
        default: Date.now
    },
    views: {
        type: Number,
        default: 0
    },
    description: {
        type: String,
        default: ''
    },
    content: {
        type: String,
        default: ''
    },
    user: {
        type: mongoose.Schema.ObjectId,
        //引用
        ref: 'user'
    },
    //评论
    comments: {
        type: Array,
        default: []
    },
    artcleImg: String,
    //发布状态
    isStatus: {
        type: Boolean,
        default: false
    },
    //草稿
    isCaogao: {
        type: Boolean,
        default: false
    }


});